<%@ include file="../system/HeaderStrutsForm.jsp" %>
<html>
  <head>

    <bean:message key="page.css"/>
    <bean:message key="page.script"/>
  </head>
  <center>
    <body>
      <table class="mainTable" style='width:99%;'>
        <tr>
          <td>
            <html:form 
                action="Enderecos/PesquisarCepForm.do"
                method="POST"
                onsubmit="return confirmSubmit();"
                scope="session"
                styleClass="baseForm"
                target="_self">


              <table class="bannerTable" style='width:99%;'>
                <tr>
                  <td class=tableHeader>
                    Pesquisar CEP
                  </td>
                </tr>
              </table>
              <table class="messageTable" style='width:99%;'>
                <tr>
                  <td class="messageHeader">
                    <bean:message key="div.campos*"/>
                    <html:errors/>
                  </td>
                </tr>
              </table>
              <table class="itemTable" style='width:99%;'>
                <html:hidden property="ceps_logradouro"/>
                <html:hidden property="ceps_bairro"/>
                <html:hidden property="ceps_cidade"/>
                <html:hidden property="ceps_id"/>
                <tr>
                  <td class="formLabel">
                    <span class="spamFormLabel" >
                      CEP
                    </span>
                  </td>
                  <td class="formField">
                    <html:text property="ceps_numero" styleClass="baseField"/>
                  </td>
                </tr>
                <tr>
                  <td class="formLabel">
                    <span class="spamFormLabel" >
                      Cidade
                    </span>
                  </td>
                  <td class="formField">
                    <html:text 
                        property="cida_descricao"
                        size="50"
                        maxlength="80"
                        styleClass="baseField"
                    />
                    <input 
                        type=button
                        class="lovButton"
                        value="..."
                        onclick="window.open('../lov/CidadeLov.do?popup_action=&return0=ceps_cidade&return1=cida_descricao','','scrollbars,height=550,width=520,TOP=0,LEFT=0')"/>
                  </td>
                </tr>
                <tr>
                  <td class="formLabel">
                    <span class="spamFormLabel" >
                      Bairro
                    </span>
                  </td>
                  <td class="formField">
                    <html:text 
                        property="bair_descricao"
                        styleClass="baseField"
                        size="50"
                        maxlength="80"
                    />
                    <input 
                        type=button
                        class="lovButton"
                        value="..."
                        onclick="window.open('../lov/BairroLov.do?popup_action=&return0=ceps_bairro&return1=bair_descricao','','scrollbars,height=550,width=520,TOP=0,LEFT=0')"/>
                  </td>
                </tr>



                <tr>
                  <td class="formLabel">
                    <span class="spamFormLabel" >
                      Logradouro
                    </span>
                  </td>
                  <td class="formField">
                    <html:text 
                        property="logr_descricao"
                        styleClass="baseField"
                        size="70"
                        maxlength="100"/>
                    <input 
                        type=button
                        class="lovButton"
                        value="..."
                        onclick="window.open('../lov/LogradouroLov.do?popup_action=&return0=ceps_logradouro&return1=logr_descricao','','scrollbars,height=550,width=650,TOP=0,LEFT=0')"/>
                  </td>
                </tr>
                <tr>
                  <td class="formLabel">
                    <span class="spamFormLabel" >
                      Lista de Ceps no Banco
                    </span>
                  </td>
                  <td class="formField">
                    <display:table 
                        name="cepsResult"
                        scope="session"
                        class="displayTag"
                        pagesize="10"
                        decorator="br.com.werp.regras.endereco.visao.decorador.CepAlterar">


                      <display:column property="ceps_numero"    title="CEP" />
                      <display:column 
                          property="logr_tipo"


                           title="Tipo Logr"
                      />
                      <display:column 
                          property="logr_descricao"
                          title="Logradouro"
                      />
                      <display:column 
                          property="bair_descricao"
                          title="Bairro"
                      />
                      <display:column 
                          property="cida_descricao"
                          title="Cidade"
                      />
                      <display:column 
                          property="unfd_descricao"
                          title="Estado"
                      />
                    </display:table>
                  </td>
                </tr>
              </table>
              <table class="buttonTable" style='width:99%;'>
                <tr>
                  <td class="buttonItem">
                    <html:submit 
                        value="Pesquisar"
                        styleClass="baseButton"
                        property="pesquisar_action">


                    </html:submit>
                    <html:submit 
                        accesskey="l"
                        styleClass="baseButton"
                        property="resetfull_action">


                      <bean:message 
                          bundle="ApplicationResources"
                          key="jsp.reset"/>
                    </html:submit>
                  </td>
                </tr>
              </table>
            </html:form>

          </td>
        </tr>
      </table>
    </body>
  </center>
</html>
